package com.wctj.api.base.utils;

import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import lombok.extern.slf4j.Slf4j;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Slf4j
public class OrderIdUtils {

    public static String getOrderId(){
        DateTimeFormatter ofPattern = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
        String localDate = LocalDateTime.now().format(ofPattern);
        return localDate + IdWorker.getId();
    }
    public static long getId(){
        return IdWorker.getId();
    }

}
